<?php
/**
 * Created by 项目.
 * User: xuguopeng
 * Date: 2020-06-19
 * Time: 18:49
 */

namespace app\api\model;


class User extends BaseModel
{
    public function getMemberEndTimeAttr($value)
    {
        $time = time();
        if(!$value) {
            return '未支付会员';
        } else {
            if($time > $value) {
                return '会员已过期';
            } else {
                return date('Y-m-d',$value);
            }
        }
    }

    public function getMemberStartTimeAttr($value)
    {
        if($value) {
            return date('Y-m-d',$value);
        } else {
            return date('Y-m-d',time());
        }
    }
}